package com.webserver.http;

import java.util.HashMap;
import java.util.Map;
/*
* 资源后缀与Content-Type头的对应关系
* key 资源后缀名    value Content-Type对应的值
* */
public class HttpContext {
    private static Map<String ,String >mineMapping = new HashMap<>();
    static {
        initMineMapping();//初始化mineMapping
    }
    private static void initMineMapping(){
        mineMapping.put("html","text/html");
        mineMapping.put("css","text/css");
        mineMapping.put("js","application/javascript");
        mineMapping.put("png","image/png");
        mineMapping.put("gif","image/gif");
        mineMapping.put("jpg","image/jpeg");
    }

    public static String getMineMapping(String ext) {
        return mineMapping.get(ext);
    }
}
